package com.tz.movie.domain;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.alibaba.fastjson.JSONObject;

import freemarker.template.SimpleDate;

public class Movie {
  private Integer id;

  private String name;

  private String info;

  private Integer cateid;

  private Date opentime;

  private Date endtime;

  private Double price;

  private Integer remain;

  private Integer sell;

  private String postimg;

  private String videourl;

  @Override
  public String toString() {

    JSONObject jsonObject = new JSONObject();
    jsonObject.put("id", getId());
    jsonObject.put("name", getName());
    jsonObject.put("info", getInfo());
    jsonObject.put("cateid", getCateid());
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    jsonObject.put("opentime",  simpleDateFormat.format(getOpentime()));
    jsonObject.put("endtime", simpleDateFormat.format(getEndtime()));
    jsonObject.put("price", getPrice());
    jsonObject.put("remain", getRemain());
    jsonObject.put("sell", getSell());
    jsonObject.put("postimg", getPostimg());
    jsonObject.put("videourl", getVideourl());
    return jsonObject.toJSONString();
  }

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name == null ? null : name.trim();
  }

  public String getInfo() {
    return info;
  }

  public void setInfo(String info) {
    this.info = info == null ? null : info.trim();
  }

  public Integer getCateid() {
    return cateid;
  }

  public void setCateid(Integer cateid) {
    this.cateid = cateid;
  }

  public Date getOpentime() {
    return opentime;
  }

  public void setOpentime(Date opentime) {
    this.opentime = opentime;
  }

  public Date getEndtime() {
    return endtime;
  }

  public void setEndtime(Date endtime) {
    this.endtime = endtime;
  }

  public Double getPrice() {
    return price;
  }

  public void setPrice(Double price) {
    this.price = price;
  }

  public Integer getRemain() {
    return remain;
  }

  public void setRemain(Integer remain) {
    this.remain = remain;
  }

  public Integer getSell() {
    return sell;
  }

  public void setSell(Integer sell) {
    this.sell = sell;
  }

  public String getPostimg() {
    return postimg;
  }

  public void setPostimg(String postimg) {
    this.postimg = postimg == null ? null : postimg.trim();
  }

  public String getVideourl() {
    return videourl;
  }

  public void setVideourl(String videourl) {
    this.videourl = videourl == null ? null : videourl.trim();
  }
}